function [ originMatrix ] = hanlerPing( type,interval)
%UNTITLED3 Summary of this function goes here
%   Detailed explanation goes here
load('dataset/pings_4hr/pings_4hr.mat');

[m n]=size(pings);
val = interval*1000;

originMatrixTemp=zeros(226*226, type*3600000/val);
addTimes=zeros(226*226, type*3600000/val);


for i=1:1:m
    xLoc = (pings(i,2)*226+(pings(i,3)+1));
    yLoc = floor(pings(i,1)/val)+1;
    temp= originMatrixTemp(xLoc,yLoc);
    addTimes(xLoc,yLoc)=addTimes(xLoc,yLoc)+1;
    originMatrixTemp(xLoc,yLoc) = temp+ pings(i,4);
end
addTimes(addTimes==0)=1;
originMatrixTemp = originMatrixTemp./addTimes;

originMatrix = originMatrixTemp;
[a b]=size(originMatrix);
for i=a:-1:1
    if sum(originMatrix(i,:))==0
        originMatrix(i,:)=[];
    end
end

end

